import unittest
from test_cases import test_demo1, test_demo2

loader1 = unittest.defaultTestLoader.loadTestsFromTestCase(test_demo1.TestDemo1TestCase)
loader2 = unittest.defaultTestLoader.loadTestsFromTestCase(test_demo2.TestDemo2TestCase)

# 创建一个测试套件
# 创建一个测试套件, 收集测试类
suite = unittest.TestSuite()
# addTest()
# suite.addTest(loader1)
# suite.addTest(loader2)
# addTests()
suite.addTests([loader1, loader2])

# 创建执行器,执行测试类
runner = unittest.TextTestRunner()
runner.run(suite)